package com.catering.controller;

import com.catering.service.CateringSpacesService;
import com.catering.until.Log;
import com.catering.until.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/cateringSpaces")
public class CateringSpacesController {
	
	@Autowired
	private CateringSpacesService cateringSpacesSevice;
	
	@RequestMapping("/select")
	public ResultData select(@RequestBody Map<String,String> map) {
		return cateringSpacesSevice.select(map);
	}

	@RequestMapping("/selectSpaces")
	public ResultData selectSpaces(@RequestBody Map<String,String> map) {
		return cateringSpacesSevice.selectSpaces(map);
	}

	@Log(operation = "新增" , remark="【父级规格】新增父级规格" , type = "3")
	@RequestMapping("/insert")
	public ResultData insert(@RequestBody Map<String,String> map) {
		cateringSpacesSevice.insert(map);
		return cateringSpacesSevice.insert(map);
	}

	@Log(operation = "修改" , remark="【父级规格】修改父级规格" , type = "3")
	@RequestMapping("/update")
	public ResultData update(@RequestBody Map<String,String> map) {
		return cateringSpacesSevice.update(map);
	}
	
	@Log(operation = "删除" , remark="【父级规格】删除父级规格" , type = "3")
	@RequestMapping("/delete")
	public ResultData delete(@RequestBody Map<String,Object> map) {
		return cateringSpacesSevice.delete(map);
	}
	
}
